Electronic device for implementing method for producing animated face

ABSTRACT

An electronic device includes a display screen, a processor, and a memory. The processor is configured to obtain attributive information of a facial image, divide the facial image into different attributive portions according to the attributive information, calculate a surface area of each attributive area, determine whether any one of the attributive areas is a distorted area, arrange the attributive areas, when one of the attributive areas is a distorted area, according to a degree of distortion from a largest degree of distortion to a smallest degree of distortion, and process a preset number of the attributive areas having the largest degree of distortion.

FIELD

The subject matter herein generally relates to animation technology, andmore particularly to an electronic device implementing a method forproducing an animated face from a facial image.

BACKGROUND

In the art of animation, using a facial image as a basis for processingby a computing device is of increasing interest.

BRIEF DESCRIPTION OF THE DRAWINGS

Implementations of the present disclosure will now be described, by wayof example only, with reference to the attached figures.

FIG. 1 is a block diagram of an embodiment of an electronic device inaccordance with an embodiment of the present disclosure.

FIG. 2 is a block diagram of function modules of an animated faceproducing system implemented by the electronic device in FIG. 1.

FIG. 3 is a flowchart of a diagram for producing an animated face.

FIG. 4 is a diagram of a facial image processed by the animated faceproducing system.

DETAILED DESCRIPTION

It will be appreciated that for simplicity and clarity of illustration,where appropriate, reference numerals have been repeated among thedifferent figures to indicate corresponding or analogous elements.Additionally, numerous specific details are set forth in order toprovide a thorough understanding of the embodiments described herein.However, it will be understood by those of ordinary skill in the artthat the embodiments described herein can be practiced without thesespecific details. In other instances, methods, procedures and componentshave not been described in detail so as not to obscure the relatedrelevant feature being described. The drawings are not necessarily toscale and the proportions of certain parts may be exaggerated to betterillustrate details and features. The description is not to be consideredas limiting the scope of the embodiments described herein.

Several definitions that apply throughout this disclosure will now bepresented.

The term “coupled” is defined as connected, whether directly orindirectly through intervening components, and is not necessarilylimited to physical connections. The connection can be such that theobjects are permanently connected or releasably connected. The term“comprising” means “including, but not necessarily limited to”; itspecifically indicates open-ended inclusion or membership in aso-described combination, group, series and the like.

In general, the word “module” as used hereinafter refers to logicembodied in hardware or firmware, or to a collection of softwareinstructions, written in a programming language such as, for example,Java, C, or assembly. One or more software instructions in the modulesmay be embedded in firmware such as in an erasable-programmableread-only memory (EPROM). It will be appreciated that the modules maycomprise connected logic units, such as gates and flip-flops, and maycomprise programmable units, such as programmable gate arrays orprocessors. The modules described herein may be implemented as eithersoftware and/or hardware modules and may be stored in any type ofcomputer-readable medium or other computer storage device.

FIG. 1 illustrates an embodiment of an animated face producing system 10implemented in an electronic device 1. The electronic device 1 includes,but is not limited to, a display screen 11, a networking unit 12, amemory 13, and a processor 14. The display screen 11, the networkingunit 12, the memory 13, and the processor 14 are mutually electricallycoupled together. FIG. 1 does not illustrate every component of theelectronic device 1, and that the electronic device 1 may include othercomponents, such as a circuit board, a sound system, an input/outputport, a battery, an operating system, and the like. The electronicdevice 1 may be, but is not limited to, a mobile phone, a tabletcomputer, a desktop computer, or an all-in-one device.

In at least one embodiment, the display screen 11 may include touchresponse functionality and may be a liquid crystal display or an organiclight-emitting diode. The display screen 11 displays image data.

In at least one embodiment, the memory 13 stores a plurality of softwareinstructions of the electronic device 1. The memory 13 may be aninternal memory of the electronic device 1, such as a hard disk. Thememory 13 may include, but is not limited to, a read-only memory, arandom access memory, a programmable read-only memory, an erasableprogrammable read-only memory, a one-time programmable read-only memory,an electrically-erasable programmable read-only memory, anelectrically-erasable programmable read-only memory, a compact discread-only memory, or other optical storage disk, magnetic storage disc,or magnetic storage tape.

In at least one embodiment, the memory 13 stores the animated faceproducing system 10. The animated face producing system 10 compares asurface area of each of a plurality of attributive areas of a facialimage to an average surface area of the attributive area to determinewhether the attributive area is distorted. When the attributive area isdistorted, the attributive areas are arranged according to a degree ofdistortion from a largest degree of distortion to a smallest degree ofdistortion, and a preset number of the attributive areas having thelargest degree of distortion are processed. The processed facial imageis then outputted to obtain an animated face.

The processor 14 may be a central processing unit, a microprocessingunit, or other data processing chip. The memory 13 can store theanimated face producing system 10, and the animated face producingsystem 10 can be executed by the processor 14. In another embodiment,the animated face producing system 10 can be embedded in the processor14. The animated face producing system 10 can be divided into aplurality of modules, which can include one or more software programs inthe form of computerized codes stored in the memory 13. The computerizedcodes can include instructions executed by the processor 14 to providefunctions for the modules.

In at least one embodiment, the electronic device 1 further includes adatabase 15 configured to store a plurality of facial images. Theaverage surface area of each attributive area is calculated according tothe plurality of facial images saved in the database 15. Because ofvariation in position of a face in each facial image and variation inimage size of the facial images, the plurality of facial images storedin the database 15 are required to be normalized. Normalization of thefacial images includes translation, zoom-in, zoom-out, and rotation ofthe facial images to ensure a high degree of normalization.

The average surface area of each attributive area is calculatedaccording to the total number of facial images stored in the database15. For example, if the database 15 stores one million facial images,then the average surface area of each attributive area is calculatedaccording to the measured surface areas of each attributive area of onemillion facial images. An example of an attributive area is the eyes ofthe facial image. In this case, the average surface area of the eyes iscalculated according to the measured surface area of the eyes of the onemillion facial images.

FIG. 2 illustrates the animated face producing system 10 being dividedinto a plurality of modules, such as an obtaining module 101, a dividingmodule 102, a calculating module 103, a comparing module 104, aprocessing module 105, and a displaying module 106. The modules 101-106can include one or more software programs in the form of computerizedcodes stored in the memory 13. The computerized codes can includeinstructions executed by the processor 14 to provide functions for themodules 101-106.

The obtaining module 101 obtains a facial image of a user.

In at least one embodiment, the obtaining module 101 obtains the facialimage of a user through a video captured by a camera (not shown infigures). The obtaining module 101 implements a facial image detectionalgorithm to detect each frame of the video to determine whether a faceappears in the video. When a face appears in the video, the obtainingmodule 101 saves the frame of the video to obtain the facial image. Theobtaining module 101 can further capture still images and detect whethera face appears in the still images to obtain the facial image.

The facial image detection algorithm can be at least one of thefollowing: a sample face detection method, an artificial neural networkface detection method, a model face detection method, a skin color facedetection method, or a characteristic face detection method.

The obtaining module 101 pre-processes the facial image. In at least oneembodiment, the pre-processing of the facial image includesnormalization of geometric characteristics. The normalization ofgeometric characteristics refers to normalizing the position, angle, andsize of the facial image. Since spacing between the eyes of a majorityof people are relatively the same, the eyes are often used as a basisfor normalization of geometric characteristics.

For example, positions of the left and right eyes of the facial imageare represented as E_(l) and E_(r) (shown in FIG. 4), and thenormalization of geometric characteristics is accomplished as describedbelow.

A) the facial image is rotated until a line segment E_(l)E_(r) ishorizontal. In this way, a direction of the facial images is normalized.

B) the facial image is cropped according to a predetermined proportion.For example, a point O is a midpoint of line segment E_(l)E_(r) , andd=E_(l)E_(r) . By cropping the facial image having dimensions of 2d×2d,point O is maintained at a position of (0.5d, d). Thus, a position ofeach facial image is the same and not changed by translation of thefacial image in a plane.

C) the cropped facial image is shrunk or enlarged to normalize the sizeof the facial image. For example, if the size of the facial image is setas 128×128 pixels, such that a distance d=E_(l)E_(r) is equal to 64pixels, then a zoom multiple is defined as β=2d/128 Thus, the sizes ofthe facial images are made the same, and a dimension of the facial imageis not changed within a plane.

The obtaining module 101 obtains attributive data of the processedfacial images.

In at least one embodiment, the obtaining module 101 uses acharacteristic face detection algorithm to obtain the attributive data.The attributive data includes data of the eyes, nose, mouth, eyebrows,and cheeks.

In another embodiment, the characteristic data further includes data ofthe cheek bones, philtrum, moles, and ears.

In at least one embodiment, the characteristic face detection algorithmmay be at least one of the following: Gabor characteristics, histogramof oriented gradient, local binary patterns, principal componentanalysis, linear discriminant analysis, or independent componentanalysis.

In at least one embodiment, the facial detection algorithm and thecharacteristic face detection algorithm are not limited to the onesdescribed above. Any facial algorithm for detecting facial areas andfacial characteristics may be used. Facial detection and facialcharacteristic detection algorithms are known in the art and will not bedescribed further.

The dividing module 102 divides the processed facial image into aplurality of attributive areas according to the characteristic data. Inat least one embodiment, the dividing module 102 divides the processedfacial image into an eyes area, a mouth area, an eyebrow area, a cheekarea, a cheekbone area, and an ears area.

The calculating module 103 calculates a surface area of the attributiveareas. In at least one embodiment, the calculating module 103 can firstcalculate the pixels of the attributive areas of the processed facialimage, and then calculate the surface area of the attributive areasaccording to the size dimensions of the pixels.

The comparing module 104 compares the surface area of the attributiveareas to the average surface area of the attributive areas to determinewhether any of the attributive areas is distorted.

In at least one embodiment, the average surface area of the attributiveareas is stored in the database 15.

The comparing module 104 determines that the attributive area isdistorted when the surface area and the average surface area have anabsolute value difference greater than or equal to a predeterminedamount. The comparing module 104 determines that the attributive area isnot distorted when the surface area and the average surface area have anabsolute value difference less than the predetermined amount.

For example, if the surface area of the eyes and the average surfacearea of the eyes stored in the database 15 have an absolute valuedifference greater than or equal to the predetermined amount, then thecomparing module 104 determines that the eyes are distorted.

The processing module 105 arranges the plurality of attributive areasaccording to a degree of distortion from a largest degree of distortionto a smallest degree of distortion, and selects a preset number of theattributive areas having a highest degree of distortion.

In at least one embodiment, the degree of distortion refers to theabsolute value difference between the surface area and the averagesurface area.

The processing module 105 processes the preset number of attributiveareas having the highest degree of distortion. The other attributiveareas are not processed.

In at least one embodiment, the attributive areas are processed byenlarging, shrinking, and deforming and exaggerating processing.

The display module 106 outputs the processed facial images on thedisplay screen 11.

FIG. 3 illustrates a flowchart of an exemplary method for providing ananimated face. The example method is provided by way of example, asthere are a variety of ways to carry out the method. The methoddescribed below can be carried out using the configurations illustratedin FIGS. 1-2 and 4, for example, and various elements of these figuresare referenced in explaining the example method. Each block shown inFIG. 3 represents one or more processes, methods, or subroutines carriedout in the example method. Furthermore, the illustrated order of blocksis by example only, and the order of the blocks can be changed.Additional blocks can be added or fewer blocks can be utilized, withoutdeparting from this disclosure. The example method can begin at blockS31.

At block S31, the obtaining module obtains the facial image.

In at least one embodiment, the obtaining module 101 obtains the facialimage of a user through a video captured by a camera (not shown infigures). The obtaining module 101 implements a facial image detectionalgorithm to detect each frame of the video to determine whether a faceappears in the video. When a face appears in the video, the obtainingmodule 101 saves the frame of the video to obtain the facial image. Theobtaining module 101 can further capture still images and detect whethera face appears in the still images to obtain the facial image.

The facial image detection algorithm can be at least one of thefollowing: a sample face detection method, an artificial neural networkface detection method, a model face detection method, a skin color facedetection method, or a characteristic face detection method.

At block S32, the obtaining module 101 pre-processes the facial image.In at least one embodiment, the pre-processing of the facial imageincludes normalization of geometric characteristics. The normalizationof geometric characteristics refers to normalizing the position, angle,and size of the facial image. Since spacing between the eyes of amajority of people are relatively the same, the eyes are often used as abasis for normalization of geometric characteristics.

For example, positions of the left and right eyes of the facial imageare represented as E_(l) and E_(r) (shown in FIG. 4), and thenormalization of geometric characteristics is accomplished as describedbelow.

A) the facial image is rotated until a line segment E_(l)E_(r) ishorizontal. In this way, a direction of the facial images is normalized.

B) the facial image is cropped according to a predetermined proportion.For example, a point O is a midpoint of line segment E_(l)E_(r) , andd=E_(l)E_(r) . By cropping the facial image having dimensions of 2d×2d,point O is maintained at a position of (0.5d, d). Thus, a position ofeach facial image is the same and not changed by translation of thefacial image in a plane.

C) the cropped facial image is shrunk or enlarged to normalize the sizeof the facial image. For example, if the size of the facial image is setas 128×128 pixels, such that a distance d=E_(l)E_(r) equal to 64 pixels,then a zoom multiple is defined as β=2d/128. Thus, the sizes of thefacial images are made the same, and a dimension of the facial image isnot changed within a plane.

At block S33, the obtaining module 101 obtains attributive data of theprocessed facial images.

In at least one embodiment, the obtaining module 101 uses acharacteristic face detection algorithm to obtain the attributive data.The attributive data includes data of the eyes, nose, mouth, eyebrows,and cheeks.

In another embodiment, the characteristic data further includes data ofthe cheek bones, philtrum, moles, and ears.

In at least one embodiment, the characteristic face detection algorithmmay be at least one of the following: Gabor characteristics, histogramof oriented gradient, local binary patterns, principal componentanalysis, linear discriminant analysis, or independent componentanalysis.

At block S34, the dividing module 102 divides the processed facial imageinto a plurality of attributive areas according to the characteristicdata. In at least one embodiment, the dividing module 102 divides theprocessed facial image into an eyes area, a mouth area, an eyebrow area,a cheek area, a cheekbone area, and an ears area.

At block S35, the calculating module 103 calculates a surface area ofthe attributive areas. In at least one embodiment, the calculatingmodule 103 can first calculate the pixels of the attributive areas ofthe processed facial image, and then calculate the surface area of theattributive areas according to the size dimensions of the pixels.

At block S36, the comparing module 104 compares the surface area of theattributive areas to the average surface area of the attributive areasto determine whether any of the attributive areas is distorted.

When the surface area and the average surface area have an absolutevalue difference greater than or equal to a predetermined amount, thecomparing module 104 determines that the attributive area is distorted,and block S37 is implemented. When the surface area and the averagesurface area have an absolute value difference less than thepredetermined amount, the comparing module 104 determines that theattributive area is not distorted, and the method ends.

At block S37, the processing module 105 arranges the plurality ofattributive areas according to a degree of distortion from a largestdegree of distortion to a smallest degree of distortion, and selects apreset number of the attributive areas having a highest degree ofdistortion. For example, the processing module 105 selects twoattributive areas having the highest degree of distortion.

In at least one embodiment, the degree of distortion refers to theabsolute value difference between the surface area and the averagesurface area.

At block S38, the processing module 105 processes the preset number ofattributive areas having the highest degree of distortion.

In at least one embodiment, the attributive areas are processed byenlarging, shrinking, and deforming and exaggerating processing.

At block S39, the displaying module 106 outputs the processed facialimage on the display screen 11.

The embodiments shown and described above are only examples. Even thoughnumerous characteristics and advantages of the present technology havebeen set forth in the foregoing description, together with details ofthe structure and function of the present disclosure, the disclosure isillustrative only, and changes may be made in the detail, including inmatters of shape, size and arrangement of the parts within theprinciples of the present disclosure up to, and including, the fullextent established by the broad general meaning of the terms used in theclaims.

What is claimed is:
 1. A method for producing an animated faceimplemented in an electronic device, the method comprising: obtainingattributive information of a facial image; dividing the facial imageinto a plurality of different attributive areas according to theattributive information; calculating a surface area of each attributivearea; determining whether any one of the attributive areas is adistorted area; arranging the plurality of attributive areas, when oneof the attributive areas is a distorted area, according to a degree ofdistortion from a largest degree of distortion to a smallest degree ofdistortion; and processing a preset number of the attributive areashaving the largest degree of distortion.
 2. The method of claim 1,wherein before the attributive information of the facial image isobtained, the facial image is obtained and pre-processed.
 3. The methodof claim 2, wherein the pre-processing comprises normalization ofgeometric characteristics.
 4. The method of claim 1, wherein processingof the attributive area comprises enlarging, shrinking, and deformationexaggeration processing.
 5. The method of claim 1, wherein theattributive area is determined to be distorted by comparing the surfacearea of the attributive area to an average surface area of thecorresponding attributive area; when the surface area of the attributivearea and the average surface area of the corresponding attributive areahave an absolute value difference greater than a predetermined amount, acharacteristic area is determined to be the distorted area; when thesurface area of the attributive area and the average surface area of thecorresponding attributive area have an absolute value difference lessthan the predetermined amount, the characteristic area is determined tonot be a distorted area.
 6. The method of claim 5, wherein the averagesurface area of each attributive area is calculated according to aplurality of facial images saved in a database of the electronic device.7. The method of claim 1, wherein the degree of distortion refers to anabsolute value difference between the surface area of the attributivearea and the average surface area of the corresponding attributive area.8. The method of claim 1, further comprising outputting the processedfacial image on a display screen of the electronic device.
 9. Anelectronic device comprising: a display screen; a processor; and amemory having stored therein a plurality of instruction, which whenexecuted by the processor, cause the processor to: obtain attributiveinformation of a facial image; divide the facial image into a pluralityof different attributive areas according to the attributive information;calculate a surface area of each attributive area; determine whether anyone of the attributive areas is a distorted area; arrange the pluralityof attributive areas, when one of the attributive areas is a distortedarea, according to a degree of distortion from a largest degree ofdistortion to a smallest degree of distortion; and process a presetnumber of the attributive areas having the largest degree of distortion.10. The electronic device of claim 9, wherein before the attributiveinformation of the facial image is obtained, the facial image isobtained and pre-processed by normalization of geometriccharacteristics.
 11. The electronic device of claim 9, whereinprocessing of the attributive area comprises enlarging, shrinking, anddeformation exaggeration processing.
 12. The electronic device of claim9, wherein the attributive area is determined to be distorted bycomparing the surface area of the attributive area to an average surfacearea of the corresponding attributive area; when the surface area of theattributive area and the average surface area of the correspondingattributive area have an absolute value difference greater than apredetermined amount, a characteristic area is determined to be thedistorted area; when the surface area of the attributive area and theaverage surface area of the corresponding attributive area have anabsolute value difference less than the predetermined amount, thecharacteristic area is determined to not be a distorted area.
 13. Theelectronic device of claim 12, wherein the average surface area of eachattributive area is calculated according to a plurality of facial imagessaved in a database of the electronic device.
 14. The electronic deviceof claim 9, wherein the processor is further configured to output theprocessed facial image on the display screen of the electronic device.15. A non-transitory storage medium having stored thereon instructionsthat, when executed by at least one processor of an electronic device,causes the at least one processor to execute instructions of a methodfor producing an animated face, the method comprising: obtainingattributive information of a facial image; dividing the facial imageinto a plurality of different attributive areas according to theattributive information; calculating a surface area of each attributivearea; determining whether any one of the attributive areas is adistorted area; arranging the plurality of attributive areas, when oneof the attributive areas is a distorted area, according to a degree ofdistortion from a largest degree of distortion to a smallest degree ofdistortion; and processing a preset number of the attributive areashaving the largest degree of distortion.
 16. The non-transitory storagemedium of claim 15, wherein before the attributive information of thefacial image is obtained, the facial image is obtained and pre-processedby normalization of geometric characteristics.
 17. The non-transitorystorage medium of claim 15, wherein processing of the attributive areacomprises enlarging, shrinking, and deformation exaggeration processing.18. The non-transitory storage medium of claim 15, wherein theattributive area is determined to be distorted by comparing the surfacearea of the attributive area to an average surface area of thecorresponding attributive area; when the surface area of the attributivearea and the average surface area of the corresponding attributive areahave an absolute value difference greater than a predetermined amount, acharacteristic area is determined to be the distorted area; when thesurface area of the attributive area and the average surface area of thecorresponding attributive area have an absolute value difference lessthan the predetermined amount, the characteristic area is determined tonot be a distorted area.
 19. The non-transitory storage medium of claim18, wherein the average surface area of each attributive area iscalculated according to a plurality of facial images saved in a databaseof the electronic device.
 20. The non-transitory storage medium of claim15, wherein the processor is further configured to output the processedfacial image on the display screen of the electronic device.